HOB_TYPE_PAL_VM_SUMMARY,
HOB_TYPE_PAL_VM_INFO,
HOB_TYPE_PAL_VM_PAGE_SIZE,
+ HOB_TYPE_NR_VCPU,
HOB_TYPE_MAX
}hob_type_t;
static int hob_init( void *buffer ,unsigned long buf_size);
static int add_pal_hob(void* hob_buf);
static int add_mem_hob(void* hob_buf, unsigned long dom_mem_size);
+static int add_vcpus_hob(void* hob_buf, unsigned long nr_vcpu);
static int build_hob (void* hob_buf, unsigned long hob_buf_size,
- unsigned long dom_mem_size);
+ unsigned long dom_mem_size, unsigned long vcpus);
static int load_hob(int xc_handle,uint32_t dom, void *hob_buf,
unsigned long dom_mem_size);
-int xc_ia64_build_hob(int xc_handle, uint32_t dom, unsigned long memsize){
+int xc_ia64_build_hob(int xc_handle, uint32_t dom, unsigned long memsize,
+ unsigned long vcpus){
char *hob_buf;
return -1;
}
- if ( build_hob( hob_buf, GFW_HOB_SIZE, memsize) < 0){
+ if ( build_hob( hob_buf, GFW_HOB_SIZE, memsize, vcpus) < 0){
free (hob_buf);
PERROR("Could not build hob");
return -1;
}
int build_hob (void* hob_buf, unsigned long hob_buf_size,
- unsigned long dom_mem_size)
+ unsigned long dom_mem_size, unsigned long vcpus)
{
//Init HOB List
if (hob_init (hob_buf, hob_buf_size)<0){
goto err_out;
}
+ if ( add_vcpus_hob(hob_buf, vcpus)<0){
+ PERROR("Add NR_VCPU hob failed, buffer too small");
+ goto err_out;
+ }
+
if ( add_pal_hob( hob_buf ) < 0 ){
PERROR("Add PAL hob failed, buffer too small");
goto err_out;
return 0;
}
+static int
+add_vcpus_hob(void* hob_buf, unsigned long vcpus)
+{
+ return hob_add(hob_buf, HOB_TYPE_NR_VCPU, &vcpus, sizeof(vcpus));
+}
+
unsigned char config_pal_bus_get_features_data[24] = {
0, 0, 0, 32, 0, 0, 240, 189, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}
/* Hand-off state passed to guest firmware */
- if (xc_ia64_build_hob(xc_handle, dom, dom_memsize) < 0){
+ if (xc_ia64_build_hob(xc_handle, dom, dom_memsize, (unsigned long)vcpus) < 0){
PERROR("Could not build hob\n");
goto error_out;
}